home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / bcfamily / source / viodos.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-12  |  988 b   |  48 lines

  1. //
  2. //      *******************************************************************
  3. //        JdeBP C++ Library Routines          General Public Licence v1.00
  4. //            Copyright (c) 1991,1992     Jonathan de Boyne Pollard
  5. //      *******************************************************************
  6. //
  7. // Part of FamAPI.LIB
  8. //
  9.  
  10. #include "famapi.h"
  11. #include "vio.h"
  12.  
  13. #pragma saveregs
  14. //
  15. //    Test for EGA/VGA
  16. //
  17. USHORT _APICALL
  18. VioDosGetEGASettings    ( USHORT far *ds, USHORT far *ms )
  19. {
  20.     USHORT dipswitch, memsize ;
  21.  
  22.     _AX = 0x1200;
  23.     _BX = 0xff10;
  24.     geninterrupt(0x10);
  25.     dipswitch = _CL ;
  26.     memsize = _BL ;
  27.     if ( memsize == 0x10 || dipswitch > 11 ) return ERROR_VIO_MODE ;
  28.     *ds = dipswitch ;
  29.     *ms = memsize ;
  30.     return NO_ERROR ;
  31. }
  32.  
  33. #pragma saveregs
  34. //
  35. //    Test for VGA only
  36. //
  37. USHORT _APICALL
  38. VioDosGetDCC    ( USHORT far *active )
  39. {
  40.     _AX = 0x1A00;
  41.     geninterrupt(0x10);
  42.     if (_AL != 0x1A) return ERROR_VIO_MODE ;
  43.     _AX = _BX ;
  44.     *active = _AX ;                // Changes ES:BX
  45.     return NO_ERROR ;
  46. }
  47.  
  48.